<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:t="http://myfaces.apache.org/tomahawk">

<f:view>
	<f:loadBundle var="text" basename="#{basePage.bundleName}" />
	<head>
	<title>#{text['menu.product.list.title']}</title>
		<meta name="heading" content="#{text['menu.product.list.title']}" />
	</head>

	<body id="productsList">
	<div class="separator"></div>

	<h:form id="productListForm">
		<t:dataTable id="productCategoryForm" var="product"
			style="margin-top: 10px"
			value="#{productForm.productList}" rows="25"
			styleClass="scrollerTable table" headerClass="standardTable_Header"
			rowClasses="standardTable_Row1,standardTable_Row2"
			columnClasses="standardTable_Column,standardTable_Column,standardTable_Column,standardTable_Column,standardTable_ColumnCentered">
				<t:column width="15%">
        				<f:facet name="header">
            				<t:commandSortHeader columnName="name" arrow="true">
                				<h:outputText value="#{text['menu.product.name']}" />
            				</t:commandSortHeader>
        				</f:facet>
        				<h:commandLink action="#{productForm.callEditProduct}" value="#{product.name}" >
            				<f:param name="id" value="#{product.id}"/>
        				</h:commandLink>
				</t:column>
				<t:column width="15%">
        				<f:facet name="header">
            				<t:commandSortHeader columnName="URL" arrow="true">
                				<h:outputText value="#{text['menu.product.URL']}" />
            				</t:commandSortHeader>
        				</f:facet>
        				<h:outputLink value="#{product.URL}"><h:outputText value="#{product.URL}"/></h:outputLink>
				</t:column>
				<t:column width="15%">
        				<f:facet name="header">
            				<t:commandSortHeader columnName="Price" arrow="true">
                				<h:outputText value="#{text['menu.product.price']}" />
            				</t:commandSortHeader>
        				</f:facet>        					
        					<h:outputText value="#{product.price/100}">        						
        						<f:convertNumber minFractionDigits="2" maxFractionDigits="2"/>        						
        					</h:outputText>
        					<h:outputText value="#{product.currency}"/>
				</t:column>
				<t:column width="15%">
        				<f:facet name="header">
            				<t:commandSortHeader columnName="Shop" arrow="true">
                				<h:outputText value="#{text['menu.product.shop']}" />
            				</t:commandSortHeader>
        				</f:facet>        					
        					<h:outputText value="#{product.shop.name}"/>        						
				</t:column>
				<t:column width="15%">
        				<f:facet name="header">
            				<t:commandSortHeader columnName="Category" arrow="true">
                				<h:outputText value="#{text['menu.product.category']}" />
            				</t:commandSortHeader>
        				</f:facet>        					
        					<h:outputText value="#{product.productCategory.name}"/>        						
				</t:column>
				<t:column width="15%">
        				<f:facet name="header">
            				<t:commandSortHeader columnName="image" arrow="true">
                				<h:outputText value="#{text['menu.product.image']}" />
            				</t:commandSortHeader>
        				</f:facet>
        					<t:graphicImage url="/resource/image/${product.image.URI}"></t:graphicImage>
				</t:column>
		</t:dataTable>
		<h:commandButton value="#{text['button.add']}"
			action="#{productForm.callCreate}" id="add" styleClass="button" />
	</h:form>
	</body>
</f:view>
</html>


